import request from '@/utils/request'

// 获取列表
export function getClassList(params) {
  return request({
    url: '/categories',
    method: 'get',
    params
  })
}
// 新建分类
export function addClass(data) {
  return request.post('/categories', data)
}

// 删除
export function delClass(id) {
  return request.delete(`/categories/${id}`)
}

// 获取指定分类
export function getEditDate(id) {
  return request.get(`/categories/${id}`)
}

// 编辑分类
export function EditClass(data) {
  return request.put(`/categories/${data.id}`, data)
}

// 获取分类数量
export function totalClass(params) {
  return request.get(`/categories/count`, { params })
}
